from script.get_user_info.response.nowcoder_response import nc_response
import re

# 获取用户 name
def nc_name(uid):
    html_title = nc_response(uid)
    pattern = r'<title>(.*?)的比赛主页</title>'
    match = re.search(pattern, html_title)
    if match:
        result = match.group(1)
    else:
        # 可以根据需求设置默认值或者记录日志
        result = "未知"
    return result


if __name__ == '__main__':
    print(nc_name('961118220'))